#include "Motor.h"

void Motor::Stop(void)
{
  Run(IDLE);
}

void Motor::Run(MOTORSTATE state)
{ 
  switch(state)
  {
    case CENTRIFUGE_L:
      halOutput->toggle_engine(true, 3);
      break;
    case NORMALSPEED_L:
      halOutput->toggle_engine(true, 2);
      break;
    case IDLE:
      halOutput->toggle_engine(true, 0);
      break;
    case NORMALSPEED_R:
      halOutput->toggle_engine(false, 2);
      break;
    case CENTRIFUGE_R:
      halOutput->toggle_engine(false, 3);
      break;
  }
}
